<p>Arrays, sets, and tuples can seem similar at first, but they have distinct uses. To help you know which to use, here are some rules.</p>
<p>If you need a specific, fixed collection of related values where each item has a precise position or name, you should use a tuple:</p>
<pre class="code">
<p></p>
<p><span class="keyword">let</span> address <span class="operator">=</span> <span class="punctuation">(</span>house<span class="punctuation">:</span> <span class="number">555</span><span class="punctuation">,</span> street<span class="punctuation">:</span> <span class="string">"Taylor Swift Avenue"</span><span class="punctuation">,</span> city<span class="punctuation">:</span> <span class="string">"Nashville"</span><span class="punctuation">)</span></p>
<p></p>
</pre>

<p style="height: 0px; margin-bottom: 0px;"></p>
<p>If you need a collection of values that must be unique or you need to be able to check whether a specific item is in there extremely quickly, you should use a set:</p>
<pre class="code">
<p></p>
<p><span class="keyword">let</span> <span class="keyword">set</span> <span class="operator">=</span> <span class="function">Set</span><span class="punctuation">(</span><span class="punctuation">[</span><span class="string">"aardvark"</span><span class="punctuation">,</span> <span class="string">"astronaut"</span><span class="punctuation">,</span> <span class="string">"azalea"</span><span class="punctuation">]</span><span class="punctuation">)</span></p>
<p></p>
</pre>

<p style="height: 0px; margin-bottom: 0px;"></p>
<p>If you need a collection of values that can contain duplicates, or the order of your items matters, you should use an array:</p>
<pre class="code">
<p></p>
<p><span class="keyword">let</span> pythons <span class="operator">=</span> <span class="punctuation">[</span><span class="string">"Eric"</span><span class="punctuation">,</span> <span class="string">"Graham"</span><span class="punctuation">,</span> <span class="string">"John"</span><span class="punctuation">,</span> <span class="string">"Michael"</span><span class="punctuation">,</span> <span class="string">"Terry"</span><span class="punctuation">,</span> <span class="string">"Terry"</span><span class="punctuation">]</span></p>
<p></p>
</pre>

<p style="height: 0px; margin-bottom: 0px;"></p>
<p>Arrays are by far the most common of the three types.</p>